home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / C / ASAP / appmenuitem.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-08  |  3.0 KB  |  63 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * AAppMenuItem wrapper class                                                 *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_AppMenuItem_H
  12. #define ASAP_AppMenuItem_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/WB.h>
  19. }
  20.  
  21. class AAppMenuItem : public AppMenuItem
  22. {
  23.  public:
  24.  inline static AAppMenuItem * AddAppMenuItem(unsigned long id, unsigned long userdata, UBYTE * text, MsgPort * msgport, Tag tag1,  ...);
  25.  inline void * operator new(size_t, unsigned long id, unsigned long userdata, UBYTE * text, MsgPort * msgport, Tag tag1,  ...);
  26.  inline static AAppMenuItem * AddAppMenuItemA(unsigned long id, unsigned long userdata, UBYTE * text, MsgPort * msgport, TagItem * taglist);
  27.  inline void * operator new(size_t, unsigned long id, unsigned long userdata, UBYTE * text, MsgPort * msgport, TagItem * taglist);
  28.  inline BOOL RemoveAppMenuItem();
  29.  inline void operator delete(void *);
  30. };
  31. //----------------------------------------------------------------------------
  32. AAppMenuItem * AAppMenuItem::AddAppMenuItem (unsigned long id, unsigned long userdata, UBYTE * text, MsgPort * msgport, Tag tag1,  ...)
  33. {
  34.  return AAppMenuItem::AddAppMenuItemA(id, userdata, text, msgport, (TagItem *) &tag1);
  35. }
  36. //----------------------------------------------------------------------------
  37. void * AAppMenuItem::operator new(size_t, unsigned long id, unsigned long userdata, UBYTE * text, MsgPort * msgport, Tag tag1,  ...)
  38. {
  39.  return AAppMenuItem::AddAppMenuItemA(id, userdata, text, msgport, (TagItem *) &tag1);
  40. }
  41. //----------------------------------------------------------------------------
  42. AAppMenuItem * AAppMenuItem::AddAppMenuItemA (unsigned long id, unsigned long userdata, UBYTE * text, MsgPort * msgport, TagItem * taglist)
  43. {
  44.  return (AAppMenuItem *) ::AddAppMenuItemA(id, userdata, text, msgport, taglist);
  45. }
  46. //----------------------------------------------------------------------------
  47. void * AAppMenuItem::operator new(size_t, unsigned long id, unsigned long userdata, UBYTE * text, MsgPort * msgport, TagItem * taglist)
  48. {
  49.  return AAppMenuItem::AddAppMenuItemA(id, userdata, text, msgport, taglist);
  50. }
  51. //----------------------------------------------------------------------------
  52. BOOL AAppMenuItem::RemoveAppMenuItem ()
  53. {
  54.  return ::RemoveAppMenuItem(this);
  55. }
  56. //----------------------------------------------------------------------------
  57. void AAppMenuItem::operator delete (void *appMenuItem)
  58. {
  59.  ((AAppMenuItem *) appMenuItem)->RemoveAppMenuItem();
  60. }
  61.  
  62. #endif
  63.